\hypertarget{class_caziac_1_1_http_1_1_handle_request}{
\section{Caziac::Http::HandleRequest Class Reference}
\label{class_caziac_1_1_http_1_1_handle_request}\index{Caziac::Http::HandleRequest@{Caziac::Http::HandleRequest}}
}


Handle for a Request.  




{\ttfamily \#include $<$HandleRequest.hh$>$}

\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_caziac_1_1_http_1_1_handle_request_ac9d156d250d761af3d1085ff2152e37c}{
typedef std::multimap$<$ std::string, std::string $>$ {\bfseries Header}}
\label{class_caziac_1_1_http_1_1_handle_request_ac9d156d250d761af3d1085ff2152e37c}

\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_caziac_1_1_http_1_1_handle_request_a2047264ba923f9e78966ef5965841a51}{HandleRequest} (\hyperlink{class_caziac_1_1_tools_1_1_i_reader}{Tools::IReader} $\ast$reader)
\begin{DoxyCompactList}\small\item\em constructor of the \hyperlink{class_caziac_1_1_http_1_1_handle_request}{HandleRequest} \item\end{DoxyCompactList}\item 
\hypertarget{class_caziac_1_1_http_1_1_handle_request_a52577579788d19e8f32c42f02beda5ab}{
virtual \hyperlink{class_caziac_1_1_http_1_1_handle_request_a52577579788d19e8f32c42f02beda5ab}{$\sim$HandleRequest} ()}
\label{class_caziac_1_1_http_1_1_handle_request_a52577579788d19e8f32c42f02beda5ab}

\begin{DoxyCompactList}\small\item\em destructor of the \hyperlink{class_caziac_1_1_http_1_1_handle_request}{HandleRequest} \item\end{DoxyCompactList}\item 
Header const \& \hyperlink{class_caziac_1_1_http_1_1_handle_request_a3c3c4ebd2d98f68431e4d398b8291ab0}{getHeader} () const 
\begin{DoxyCompactList}\small\item\em this function get the header of the Request \item\end{DoxyCompactList}\item 
\hyperlink{struct_caziac_1_1_http_1_1_line_request}{LineRequest} const \& \hyperlink{class_caziac_1_1_http_1_1_handle_request_a07ee7f0ca7894a795ba293adf4ee4aab}{getLineRequest} () const 
\begin{DoxyCompactList}\small\item\em this function get the \hyperlink{struct_caziac_1_1_http_1_1_line_request}{LineRequest} (method url version) \item\end{DoxyCompactList}\item 
\hyperlink{class_caziac_1_1_tools_1_1_i_reader}{Tools::IReader} $\ast$ \hyperlink{class_caziac_1_1_http_1_1_handle_request_a17a9e981953929aef1be57322233011c}{getReader} ()
\begin{DoxyCompactList}\small\item\em this function get the Reader which read the stream \item\end{DoxyCompactList}\item 
void \hyperlink{class_caziac_1_1_http_1_1_handle_request_ae64e8cec1fe855bbbcc72cd931a002cc}{readRequestHeader} ()
\begin{DoxyCompactList}\small\item\em use the reader until it will find an empty string \item\end{DoxyCompactList}\item 
virtual bool \hyperlink{class_caziac_1_1_http_1_1_handle_request_a12bdc490f263e8e9627aabb327e32c04}{consumeHeaderLine} (std::string const \&line)
\begin{DoxyCompactList}\small\item\em \mbox{[}User Implementation\mbox{]} \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_caziac_1_1_http_1_1_handle_request_a86cf15fd9fd8c2685526d16a929e0f8a}{
void \hyperlink{class_caziac_1_1_http_1_1_handle_request_a86cf15fd9fd8c2685526d16a929e0f8a}{addDescription} (std::string const \&key, std::string const \&def)}
\label{class_caziac_1_1_http_1_1_handle_request_a86cf15fd9fd8c2685526d16a929e0f8a}

\begin{DoxyCompactList}\small\item\em add a description to the Header \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Handle for a Request. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{class_caziac_1_1_http_1_1_handle_request_a2047264ba923f9e78966ef5965841a51}{
\index{Caziac::Http::HandleRequest@{Caziac::Http::HandleRequest}!HandleRequest@{HandleRequest}}
\index{HandleRequest@{HandleRequest}!Caziac::Http::HandleRequest@{Caziac::Http::HandleRequest}}
\subsubsection[{HandleRequest}]{\setlength{\rightskip}{0pt plus 5cm}Caziac::Http::HandleRequest::HandleRequest (
\begin{DoxyParamCaption}
\item[{{\bf Tools::IReader} $\ast$}]{ reader}
\end{DoxyParamCaption}
)}}
\label{class_caziac_1_1_http_1_1_handle_request_a2047264ba923f9e78966ef5965841a51}


constructor of the \hyperlink{class_caziac_1_1_http_1_1_handle_request}{HandleRequest} 


\begin{DoxyParams}{Parameters}
\item[{\em reader}]the Socket reader This will set attribue \char`\"{}\_\-reader\char`\"{} for later using \end{DoxyParams}


\subsection{Member Function Documentation}
\hypertarget{class_caziac_1_1_http_1_1_handle_request_a12bdc490f263e8e9627aabb327e32c04}{
\index{Caziac::Http::HandleRequest@{Caziac::Http::HandleRequest}!consumeHeaderLine@{consumeHeaderLine}}
\index{consumeHeaderLine@{consumeHeaderLine}!Caziac::Http::HandleRequest@{Caziac::Http::HandleRequest}}
\subsubsection[{consumeHeaderLine}]{\setlength{\rightskip}{0pt plus 5cm}virtual bool Caziac::Http::HandleRequest::consumeHeaderLine (
\begin{DoxyParamCaption}
\item[{std::string const \&}]{ line}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{class_caziac_1_1_http_1_1_handle_request_a12bdc490f263e8e9627aabb327e32c04}


\mbox{[}User Implementation\mbox{]} 


\begin{DoxyParams}{Parameters}
\item[{\em a}]line header like \char`\"{}Content-\/length : 78\char`\"{} This function parse a line and add a definition to the header with the addDescription function. The header is a multimap so when you call three times addDescription with the sames key but different definition this will save all the 3 values. \end{DoxyParams}
\hypertarget{class_caziac_1_1_http_1_1_handle_request_a3c3c4ebd2d98f68431e4d398b8291ab0}{
\index{Caziac::Http::HandleRequest@{Caziac::Http::HandleRequest}!getHeader@{getHeader}}
\index{getHeader@{getHeader}!Caziac::Http::HandleRequest@{Caziac::Http::HandleRequest}}
\subsubsection[{getHeader}]{\setlength{\rightskip}{0pt plus 5cm}Header const\& Caziac::Http::HandleRequest::getHeader (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}
\label{class_caziac_1_1_http_1_1_handle_request_a3c3c4ebd2d98f68431e4d398b8291ab0}


this function get the header of the Request 

\begin{DoxyReturn}{Returns}
the header
\end{DoxyReturn}
This function return the header parsed by the user with the consumeHeaderLine method. This member function is for consulting. \hypertarget{class_caziac_1_1_http_1_1_handle_request_a07ee7f0ca7894a795ba293adf4ee4aab}{
\index{Caziac::Http::HandleRequest@{Caziac::Http::HandleRequest}!getLineRequest@{getLineRequest}}
\index{getLineRequest@{getLineRequest}!Caziac::Http::HandleRequest@{Caziac::Http::HandleRequest}}
\subsubsection[{getLineRequest}]{\setlength{\rightskip}{0pt plus 5cm}{\bf LineRequest} const\& Caziac::Http::HandleRequest::getLineRequest (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}
\label{class_caziac_1_1_http_1_1_handle_request_a07ee7f0ca7894a795ba293adf4ee4aab}


this function get the \hyperlink{struct_caziac_1_1_http_1_1_line_request}{LineRequest} (method url version) 

\begin{DoxyReturn}{Returns}
the line request 
\end{DoxyReturn}
\begin{DoxyWarning}{Warning}
call readRequestHeader before to set the \hyperlink{struct_caziac_1_1_http_1_1_line_request}{LineRequest} attributes
\end{DoxyWarning}
This member function is only for consulting values. \hypertarget{class_caziac_1_1_http_1_1_handle_request_a17a9e981953929aef1be57322233011c}{
\index{Caziac::Http::HandleRequest@{Caziac::Http::HandleRequest}!getReader@{getReader}}
\index{getReader@{getReader}!Caziac::Http::HandleRequest@{Caziac::Http::HandleRequest}}
\subsubsection[{getReader}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Tools::IReader}$\ast$ Caziac::Http::HandleRequest::getReader (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{class_caziac_1_1_http_1_1_handle_request_a17a9e981953929aef1be57322233011c}


this function get the Reader which read the stream 

\begin{DoxyReturn}{Returns}
the reader 
\end{DoxyReturn}
\hypertarget{class_caziac_1_1_http_1_1_handle_request_ae64e8cec1fe855bbbcc72cd931a002cc}{
\index{Caziac::Http::HandleRequest@{Caziac::Http::HandleRequest}!readRequestHeader@{readRequestHeader}}
\index{readRequestHeader@{readRequestHeader}!Caziac::Http::HandleRequest@{Caziac::Http::HandleRequest}}
\subsubsection[{readRequestHeader}]{\setlength{\rightskip}{0pt plus 5cm}void Caziac::Http::HandleRequest::readRequestHeader (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{class_caziac_1_1_http_1_1_handle_request_ae64e8cec1fe855bbbcc72cd931a002cc}


use the reader until it will find an empty string 

This function consume the reader like this:


\begin{DoxyItemize}
\item read the first three world to fill the 3 \hyperlink{struct_caziac_1_1_http_1_1_line_request}{LineRequest} fields: method url version
\item call consumeHeaderLine with the line until the line returned by the reader is empty 
\end{DoxyItemize}

The documentation for this class was generated from the following file:\begin{DoxyCompactItemize}
\item 
\hyperlink{_handle_request_8hh}{HandleRequest.hh}\end{DoxyCompactItemize}
